/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package geometry;

/**
 *
 * @author rusak
 */
public class MockIntersectionAlgorithm implements IntersectionAlgorithm{

    @Override
    public Integer noOfIntersections(Segment[] efector, Obstacle[] obstacles) {
        int count = 0;
        for(int i=0; i<efector.length; i++) 
            for(int j=0; j<obstacles.length; j++) 
                for(int k=0; k<obstacles[j].size(); k++)
                    if(efector[i].intersect( obstacles[j].getEdgeAt(k) )) count++;
        return count;
    }

    @Override
    public boolean checkIfIntersect(Segment[] efector, Obstacle[] obstacles) {
        for(int i=0; i<efector.length; i++) 
            for(int j=0; j<obstacles.length; j++) 
                for(int k=0; k<obstacles[j].size(); k++)
                    if(efector[i].intersect( obstacles[j].getEdgeAt(k) )) return true;
        return false;
    }

    @Override
    public Integer[] getIntersectedObstacles(Segment[] efector, Obstacle[] obstacles) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
}
